<template>
    <div>
        <h2>修改游戏页面</h2>
        <p>游戏id：<input type="text" v-model="id" ></p>
        <p>游戏名称：<input type="text" v-model="name" ></p>
        <p><input type="button" value="修改游戏" @click="updategame(name)"></p>    
    </div>    
</template>

<script>
import {updategame} from "../axios_api/api.js"
import {getgame1} from "../axios_api/api.js"
export default {
    name:"updategame",
    data() {
        return {
            name:"",
            id:""
        }
    },
    methods:{
        updategame(){
            var data = {
                "id":this.id,
                "name":this.name
            }
            updategame(data).then(res=>{
                console.log(res)
                this.$router.push({
                name:"showgame"
            })
            })
        }
    },
}
</script>

<style>

</style>
